package cn.net.wanji.entity;

public enum EventTypeEnum {
    A(1, "慢速"),
    B(2, "超速"),
    C(3, "滞留");

    private final int number;
    private final String value;

    EventTypeEnum(int number, String value) {
        this.number = number;
        this.value = value;
    }

    public int getNumber() {
        return number;
    }

    public String getValue() {
        return value;
    }

    public static String getValueByNumber(int number) {
        for (EventTypeEnum enumValue : EventTypeEnum.values()) {
            if (enumValue.getNumber() == number) {
                return enumValue.getValue();
            }
        }
        return null; // 如果没有匹配的值，可以返回null或者其他默认值
    }

    public static void main(String[] args) {
        String valueByNumber = getValueByNumber(1);
        System.out.println(valueByNumber);
    }

}
